package com.insta.java.metier;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.insta.java.dao.LocationDao;
import com.insta.java.model.Location;

@Service("locationManager")
public class LocationManager{

	@Autowired
	LocationDao locationDao;
	
	public void setLocationDao(LocationDao locationDao){
		this.locationDao= locationDao;
	}
	
	public void save(Location location) {
		locationDao.save(location);
	}

	public void update(Location location) {
		locationDao.update(location);
	}

	public void delete(Location location) {
		locationDao.delete(location);
	}
	
	public List<Location> findByUserId(Integer id) {
		return locationDao.findByUserId(id);
	}
	
	public List<Location> findByBookIsbn(String isbn) {
		return locationDao.findByBookIsbn(isbn);
	}
	
	public Location findById(Integer id) {
		return locationDao.findById(id);
	}
}
